package ai.plantdata.controller;

import ai.plantdata.vo.DataSourceConfig;
import ai.plantdata.vo.rsp.TableStructureRsp;
import ai.plantdata.service.ReadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: WangHui
 * @Date: 2021/7/9 10:24
 * @Description:
 */
@RestController
@RequestMapping("/read")
public class ReadController {
    @Autowired
    private ReadService readService;

    @GetMapping("/structure")
    public List<TableStructureRsp> getStructure(@RequestBody DataSourceConfig dataSourceMsg) {
        return readService.getStructure(dataSourceMsg);
    }


}
